package com.thd.springboottest.ioc.ymlinject;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class YmlInjectByAnnotationComponent {
    @Value("${user.nickname}")
    private String name;
    @Value("${user.age}")
    private Integer age = 5;

    public void say(){
        System.out.println("YmlInjectByAnnotationComponent.say() ");
        System.out.println(this.name + " said : i'm " + this.age + " years old" );
    }
}
